const { Schema, model } = require('mongoose');

//设置数据集合的数据结构
const adminsSchema = new Schema(
  {
    userName: String,
    password: String,
    //默认权限 1
    permission: {
      type: String,
      default: 1,
    },
    phone: String,
  },
  {
    versionKey: false,
  }
);

// 设置数据集合的模型
const Admins = model('Admins', adminsSchema, 'admins');
module.exports.Admins = Admins;
